package ATM;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FindJpanel extends JPanel implements ActionListener {

    private JButton btnOff;
    private ATMJframe atmJframe;
    private JLabel yueLabel;
    private Icon buttonOff = Util.getimagesIcon("/images/buttonOff.jpg");


    public FindJpanel(ATMJframe atmJframe) {
        this.atmJframe = atmJframe;

        this.setLayout(null);
        this.setOpaque(false);


        btnOff = new JButton("", buttonOff);
        btnOff.setBounds(850, 550, 140, 50);
        this.add(btnOff);
        btnOff.addActionListener(this);

        yueLabel=new JLabel();
        yueLabel.setBounds(300, 200, 200, 50);
        yueLabel.setFont(new Font("宋体", Font.BOLD, 25));
        this.add(yueLabel);
    }

    public JLabel getYueLabel() {
        return yueLabel;
    }

    public void setYueLabel(JLabel yueLabel) {
        this.yueLabel = yueLabel;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == btnOff) {
            atmJframe.switchPanel("menu");
        }
    }
}
